<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#include "/views/ftl/base/manager_include.ftl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>品牌列表</title>
<style>
A{
color: #333;
}

</style>
<script type="text/javascript">
$().ready(function() {
	$("#search_button").click(function(){
		$('#select_form').submit();
    });
});

</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "品牌_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>商品管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>品牌</span></a>
      </div>
    </div>
    	
      <!--搜索框-->
        <form action="${basePath}manager/Brand_brandListPage" id="select_form"  method="GET"> 
         <div class="searchBox fl">
        	<span class=" searchTitle">品牌名:</span> 
          	<input class="search_text" type="text" name="brandName" placeholder="请输入关键字 " value="${(requestVo.brandName)!''}"/>
          	
            </div> 
            <a href="javascript:void(0);" id="search_button" class="search_btn fl" align="center"><span >搜索</span></a> 
			<a href="${basePath}manager/Brand_createBrandPage" class="search_btn fl" style="width:89px;background: #00ad55 none repeat scroll 0 0;" target="_blank"><span>添加品牌</span></a>
        </form>

        
       
        <div class="clear"></div>  
        <!--表格列表-->
        <div class="Table">
          <table id="table" cellpadding="0" cellspacing="1">
            <tbody>
              <tr id="gl">			 
              
             <td>品牌名</td>
             <td>品牌LOGO</td>
             <td>操作</td>
             </tr>
            <#if (pager.list??)> 
           <#if ((pager.list?size)>0)>
           <#list pager.list as brand>
     		<tr> 
          	<td>${brand.brandName!''}</td> 
             <td><img src="${brand.brandLogo!''}" width="80px" height="80px"></td> 
           <td class="tbl_btn">
                <a href="${basePath}manager/Brand_brandInfo?brandId=${(brand.id)?c}"><span class="review_single_model" style="    background: #00ad55;">查看</span></a>
                <a href="javascript:void(0);"><span class="delete_single_model" data-id="${(brand.id)?c}" style="background: #FF0202;">删除</span></a>
                </td>
              </tr>
  			</#list>
          </#if>
          </#if>
            </tbody>
          </table>
        </div>
    <!--翻页按钮-->
  	<#import "../../base/pager.ftl" as p>
   	<@p.pager pager = pager baseUrl = "manager/Brand_brandListPage" parameterMap={"brandName":(requestVo.brandName)!''} />
</div>
<script type="text/javascript">
$(document).ready(function(){
	
	$(".delete_single_model").click(function(){  
		if(!confirm("确定删除吗")){
		   		return ;
		}
		var brandId = $(this).attr('data-id'); 
		$.ajax({ 
			url : "${basePath }manager/Brand_removeBrand",
			data : { 
				brandId:brandId
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				if(dat.code==1){
					alert(dat.msg);
					location.reload();	 
				} 
				if(dat.code==0){
					alert(dat.msg);	
				} 
			}
		});
		
		});
	});

</script>
</body>
</html>

